string_is_alphabetic
This function returns a boolean value showing whether the passed string contains purely letters.
bool string_is_alphabetic(string the_string)
Parameters:
the_string
The string that will be evaluated.
Return value:
Returns true if the string contains purely letters, false if not or if an error occurred.
Remarks:
This function does not evaluate punctuation. If the string contains punctuation this function will return false.
Example:
void main()
{
string text1, text2;
text1="I am normal text.";
text2="Randomness";
if(string_is_alphabetic(text1))
{
alert("string_is_alphabetic test", "text1 contains letters only.");
}
else
{
alert("string_is_alphabetic test", "text1 does not contain only letters.");
}
if(string_is_alphabetic(text2))
{
alert("string_is_alphabetic test", "text2 contains letters only.");
}
else
{
alert("string_is_alphabetic test", "text2 does not contain only letters.");
}
}